Optimal. Leaf size=97 \[ -\frac {3 \cos (a-c+(b-d) x)}{8 (b-d)}+\frac {\cos (3 a-c+(3 b-d) x)}{8 (3 b-d)}-\frac {3 \cos (a+c+(b+d) x)}{8 (b+d)}+\frac {\cos (3 a+c+(3 b+d) x)}{8 (3 b+d)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 97, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 2, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {4670, 2718}
\begin {gather*} -\frac {3 \cos (a+x (b-d)-c)}{8 (b-d)}+\frac {\cos (3 a+x (3 b-d)-c)}{8 (3 b-d)}-\frac {3 \cos (a+x (b+d)+c)}{8 (b+d)}+\frac {\cos (3 a+x (3 b+d)+c)}{8 (3 b+d)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2718
Rule 4670
Rubi steps
\begin {align*} \int \cos (c+d x) \sin ^3(a+b x) \, dx &=\int \left (\frac {3}{8} \sin (a-c+(b-d) x)-\frac {1}{8} \sin (3 a-c+(3 b-d) x)+\frac {3}{8} \sin (a+c+(b+d) x)-\frac {1}{8} \sin (3 a+c+(3 b+d) x)\right ) \, dx\\ &=-\left (\frac {1}{8} \int \sin (3 a-c+(3 b-d) x) \, dx\right )-\frac {1}{8} \int \sin (3 a+c+(3 b+d) x) \, dx+\frac {3}{8} \int \sin (a-c+(b-d) x) \, dx+\frac {3}{8} \int \sin (a+c+(b+d) x) \, dx\\ &=-\frac {3 \cos (a-c+(b-d) x)}{8 (b-d)}+\frac {\cos (3 a-c+(3 b-d) x)}{8 (3 b-d)}-\frac {3 \cos (a+c+(b+d) x)}{8 (b+d)}+\frac {\cos (3 a+c+(3 b+d) x)}{8 (3 b+d)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.56, size = 90, normalized size = 0.93 \begin {gather*} \frac {1}{8} \left (-\frac {3 \cos (a-c+b x-d x)}{b-d}+\frac {\cos (3 a-c+3 b x-d x)}{3 b-d}+\frac {\cos (3 a+c+3 b x+d x)}{3 b+d}-\frac {3 \cos (a+c+(b+d) x)}{b+d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 90, normalized size = 0.93
method | result | size |
default | \(-\frac {3 \cos \left (a -c +\left (b -d \right ) x \right )}{8 \left (b -d \right )}+\frac {\cos \left (3 a -c +\left (3 b -d \right ) x \right )}{24 b -8 d}-\frac {3 \cos \left (a +c +\left (b +d \right ) x \right )}{8 \left (b +d \right )}+\frac {\cos \left (3 a +c +\left (3 b +d \right ) x \right )}{24 b +8 d}\) | \(90\) |
risch | \(-\frac {27 \cos \left (b x -d x +a -c \right ) b^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}-\frac {27 \cos \left (b x -d x +a -c \right ) b^{2} d}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}+\frac {3 \cos \left (b x -d x +a -c \right ) b \,d^{2}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}+\frac {3 \cos \left (b x -d x +a -c \right ) d^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}-\frac {27 \cos \left (b x +d x +a +c \right ) b^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}+\frac {27 \cos \left (b x +d x +a +c \right ) b^{2} d}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}+\frac {3 \cos \left (b x +d x +a +c \right ) b \,d^{2}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}-\frac {3 \cos \left (b x +d x +a +c \right ) d^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}+\frac {3 \cos \left (3 b x -d x +3 a -c \right ) b^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}+\frac {\cos \left (3 b x -d x +3 a -c \right ) b^{2} d}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}-\frac {3 \cos \left (3 b x -d x +3 a -c \right ) b \,d^{2}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}-\frac {\cos \left (3 b x -d x +3 a -c \right ) d^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (-b +d \right ) \left (-3 b +d \right )}+\frac {3 \cos \left (3 b x +d x +3 a +c \right ) b^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}-\frac {\cos \left (3 b x +d x +3 a +c \right ) b^{2} d}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}-\frac {3 \cos \left (3 b x +d x +3 a +c \right ) b \,d^{2}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}+\frac {\cos \left (3 b x +d x +3 a +c \right ) d^{3}}{8 \left (b +d \right ) \left (3 b +d \right ) \left (b -d \right ) \left (3 b -d \right )}\) | \(730\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 785 vs.
\(2 (89) = 178\).
time = 0.32, size = 785, normalized size = 8.09 \begin {gather*} \frac {{\left (3 \, b^{3} \cos \left (c\right ) - b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \cos \left ({\left (3 \, b + d\right )} x + 3 \, a + 2 \, c\right ) + {\left (3 \, b^{3} \cos \left (c\right ) - b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \cos \left ({\left (3 \, b + d\right )} x + 3 \, a\right ) + {\left (3 \, b^{3} \cos \left (c\right ) + b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \cos \left (-{\left (3 \, b - d\right )} x - 3 \, a + 2 \, c\right ) + {\left (3 \, b^{3} \cos \left (c\right ) + b^{2} d \cos \left (c\right ) - 3 \, b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \cos \left (-{\left (3 \, b - d\right )} x - 3 \, a\right ) - 3 \, {\left (9 \, b^{3} \cos \left (c\right ) - 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \cos \left ({\left (b + d\right )} x + a + 2 \, c\right ) - 3 \, {\left (9 \, b^{3} \cos \left (c\right ) - 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) + d^{3} \cos \left (c\right )\right )} \cos \left ({\left (b + d\right )} x + a\right ) - 3 \, {\left (9 \, b^{3} \cos \left (c\right ) + 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \cos \left (-{\left (b - d\right )} x - a + 2 \, c\right ) - 3 \, {\left (9 \, b^{3} \cos \left (c\right ) + 9 \, b^{2} d \cos \left (c\right ) - b d^{2} \cos \left (c\right ) - d^{3} \cos \left (c\right )\right )} \cos \left (-{\left (b - d\right )} x - a\right ) + {\left (3 \, b^{3} \sin \left (c\right ) - b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \sin \left ({\left (3 \, b + d\right )} x + 3 \, a + 2 \, c\right ) - {\left (3 \, b^{3} \sin \left (c\right ) - b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \sin \left ({\left (3 \, b + d\right )} x + 3 \, a\right ) + {\left (3 \, b^{3} \sin \left (c\right ) + b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \sin \left (-{\left (3 \, b - d\right )} x - 3 \, a + 2 \, c\right ) - {\left (3 \, b^{3} \sin \left (c\right ) + b^{2} d \sin \left (c\right ) - 3 \, b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \sin \left (-{\left (3 \, b - d\right )} x - 3 \, a\right ) - 3 \, {\left (9 \, b^{3} \sin \left (c\right ) - 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \sin \left ({\left (b + d\right )} x + a + 2 \, c\right ) + 3 \, {\left (9 \, b^{3} \sin \left (c\right ) - 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) + d^{3} \sin \left (c\right )\right )} \sin \left ({\left (b + d\right )} x + a\right ) - 3 \, {\left (9 \, b^{3} \sin \left (c\right ) + 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \sin \left (-{\left (b - d\right )} x - a + 2 \, c\right ) + 3 \, {\left (9 \, b^{3} \sin \left (c\right ) + 9 \, b^{2} d \sin \left (c\right ) - b d^{2} \sin \left (c\right ) - d^{3} \sin \left (c\right )\right )} \sin \left (-{\left (b - d\right )} x - a\right )}{16 \, {\left (9 \, b^{4} \cos \left (c\right )^{2} + 9 \, b^{4} \sin \left (c\right )^{2} + {\left (\cos \left (c\right )^{2} + \sin \left (c\right )^{2}\right )} d^{4} - 10 \, {\left (b^{2} \cos \left (c\right )^{2} + b^{2} \sin \left (c\right )^{2}\right )} d^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.76, size = 116, normalized size = 1.20 \begin {gather*} -\frac {{\left (7 \, b^{2} d - d^{3} - {\left (b^{2} d - d^{3}\right )} \cos \left (b x + a\right )^{2}\right )} \sin \left (b x + a\right ) \sin \left (d x + c\right ) - 3 \, {\left ({\left (b^{3} - b d^{2}\right )} \cos \left (b x + a\right )^{3} - {\left (3 \, b^{3} - b d^{2}\right )} \cos \left (b x + a\right )\right )} \cos \left (d x + c\right )}{9 \, b^{4} - 10 \, b^{2} d^{2} + d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 937 vs.
\(2 (76) = 152\).
time = 2.27, size = 937, normalized size = 9.66 \begin {gather*} \begin {cases} x \sin ^{3}{\left (a \right )} \cos {\left (c \right )} & \text {for}\: b = 0 \wedge d = 0 \\\frac {3 x \sin ^{3}{\left (a - d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {3 x \sin ^{2}{\left (a - d x \right )} \sin {\left (c + d x \right )} \cos {\left (a - d x \right )}}{8} + \frac {3 x \sin {\left (a - d x \right )} \cos ^{2}{\left (a - d x \right )} \cos {\left (c + d x \right )}}{8} + \frac {3 x \sin {\left (c + d x \right )} \cos ^{3}{\left (a - d x \right )}}{8} - \frac {\sin ^{3}{\left (a - d x \right )} \sin {\left (c + d x \right )}}{8 d} + \frac {3 \sin ^{2}{\left (a - d x \right )} \cos {\left (a - d x \right )} \cos {\left (c + d x \right )}}{4 d} + \frac {3 \cos ^{3}{\left (a - d x \right )} \cos {\left (c + d x \right )}}{8 d} & \text {for}\: b = - d \\\frac {x \sin ^{3}{\left (a - \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} + \frac {3 x \sin ^{2}{\left (a - \frac {d x}{3} \right )} \sin {\left (c + d x \right )} \cos {\left (a - \frac {d x}{3} \right )}}{8} - \frac {3 x \sin {\left (a - \frac {d x}{3} \right )} \cos ^{2}{\left (a - \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} - \frac {x \sin {\left (c + d x \right )} \cos ^{3}{\left (a - \frac {d x}{3} \right )}}{8} + \frac {7 \sin ^{3}{\left (a - \frac {d x}{3} \right )} \sin {\left (c + d x \right )}}{8 d} + \frac {3 \sin {\left (a - \frac {d x}{3} \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a - \frac {d x}{3} \right )}}{4 d} - \frac {3 \cos ^{3}{\left (a - \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8 d} & \text {for}\: b = - \frac {d}{3} \\\frac {x \sin ^{3}{\left (a + \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} - \frac {3 x \sin ^{2}{\left (a + \frac {d x}{3} \right )} \sin {\left (c + d x \right )} \cos {\left (a + \frac {d x}{3} \right )}}{8} - \frac {3 x \sin {\left (a + \frac {d x}{3} \right )} \cos ^{2}{\left (a + \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8} + \frac {x \sin {\left (c + d x \right )} \cos ^{3}{\left (a + \frac {d x}{3} \right )}}{8} + \frac {7 \sin ^{3}{\left (a + \frac {d x}{3} \right )} \sin {\left (c + d x \right )}}{8 d} + \frac {3 \sin {\left (a + \frac {d x}{3} \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a + \frac {d x}{3} \right )}}{4 d} + \frac {3 \cos ^{3}{\left (a + \frac {d x}{3} \right )} \cos {\left (c + d x \right )}}{8 d} & \text {for}\: b = \frac {d}{3} \\\frac {3 x \sin ^{3}{\left (a + d x \right )} \cos {\left (c + d x \right )}}{8} - \frac {3 x \sin ^{2}{\left (a + d x \right )} \sin {\left (c + d x \right )} \cos {\left (a + d x \right )}}{8} + \frac {3 x \sin {\left (a + d x \right )} \cos ^{2}{\left (a + d x \right )} \cos {\left (c + d x \right )}}{8} - \frac {3 x \sin {\left (c + d x \right )} \cos ^{3}{\left (a + d x \right )}}{8} + \frac {5 \sin ^{3}{\left (a + d x \right )} \sin {\left (c + d x \right )}}{8 d} + \frac {3 \sin {\left (a + d x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a + d x \right )}}{4 d} + \frac {3 \cos ^{3}{\left (a + d x \right )} \cos {\left (c + d x \right )}}{8 d} & \text {for}\: b = d \\- \frac {9 b^{3} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )} \cos {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} - \frac {6 b^{3} \cos ^{3}{\left (a + b x \right )} \cos {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} - \frac {7 b^{2} d \sin ^{3}{\left (a + b x \right )} \sin {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} - \frac {6 b^{2} d \sin {\left (a + b x \right )} \sin {\left (c + d x \right )} \cos ^{2}{\left (a + b x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} + \frac {3 b d^{2} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )} \cos {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} + \frac {d^{3} \sin ^{3}{\left (a + b x \right )} \sin {\left (c + d x \right )}}{9 b^{4} - 10 b^{2} d^{2} + d^{4}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.42, size = 89, normalized size = 0.92 \begin {gather*} \frac {\cos \left (3 \, b x + d x + 3 \, a + c\right )}{8 \, {\left (3 \, b + d\right )}} + \frac {\cos \left (3 \, b x - d x + 3 \, a - c\right )}{8 \, {\left (3 \, b - d\right )}} - \frac {3 \, \cos \left (b x + d x + a + c\right )}{8 \, {\left (b + d\right )}} - \frac {3 \, \cos \left (b x - d x + a - c\right )}{8 \, {\left (b - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.61, size = 471, normalized size = 4.86 \begin {gather*} -{\mathrm {e}}^{a\,3{}\mathrm {i}-c\,1{}\mathrm {i}+b\,x\,3{}\mathrm {i}-d\,x\,1{}\mathrm {i}}\,\left (\frac {-3\,b^3-b^2\,d+3\,b\,d^2+d^3}{144\,b^4-160\,b^2\,d^2+16\,d^4}+\frac {{\mathrm {e}}^{-a\,6{}\mathrm {i}-b\,x\,6{}\mathrm {i}}\,\left (-3\,b^3+b^2\,d+3\,b\,d^2-d^3\right )}{144\,b^4-160\,b^2\,d^2+16\,d^4}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (-27\,b^3-27\,b^2\,d+3\,b\,d^2+3\,d^3\right )}{144\,b^4-160\,b^2\,d^2+16\,d^4}-\frac {{\mathrm {e}}^{-a\,4{}\mathrm {i}-b\,x\,4{}\mathrm {i}}\,\left (-27\,b^3+27\,b^2\,d+3\,b\,d^2-3\,d^3\right )}{144\,b^4-160\,b^2\,d^2+16\,d^4}\right )-{\mathrm {e}}^{a\,3{}\mathrm {i}+c\,1{}\mathrm {i}+b\,x\,3{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\left (\frac {-3\,b^3+b^2\,d+3\,b\,d^2-d^3}{144\,b^4-160\,b^2\,d^2+16\,d^4}+\frac {{\mathrm {e}}^{-a\,6{}\mathrm {i}-b\,x\,6{}\mathrm {i}}\,\left (-3\,b^3-b^2\,d+3\,b\,d^2+d^3\right )}{144\,b^4-160\,b^2\,d^2+16\,d^4}-\frac {{\mathrm {e}}^{-a\,2{}\mathrm {i}-b\,x\,2{}\mathrm {i}}\,\left (-27\,b^3+27\,b^2\,d+3\,b\,d^2-3\,d^3\right )}{144\,b^4-160\,b^2\,d^2+16\,d^4}-\frac {{\mathrm {e}}^{-a\,4{}\mathrm {i}-b\,x\,4{}\mathrm {i}}\,\left (-27\,b^3-27\,b^2\,d+3\,b\,d^2+3\,d^3\right )}{144\,b^4-160\,b^2\,d^2+16\,d^4}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________